//Tags: Enumerate, Simulate
#include <cstring>
#include <iostream>
#include <string>
using std::cin;
using std::cout;
using std::string;

const int N = 25, P = 1e2 + 5;
int n, m, p, fake[N], atc[P], guilty;
bool conflict;
string name[N], str[P];
string day[7] = {"Today is Sunday",    "Today is Monday",   "Today is Tuesday",
                 "Today is Wednesday", "Today is Thursday", "Today is Friday",
                 "Today is Saturday"};

inline void set(int person, int yx) {
  if (fake[person] && fake[person] != yx) conflict = true;
  else
    fake[person] = yx;
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("P1039 侦探推理.in", "r", stdin);
  freopen("P1039 侦探推理.out", "w", stdout);
#endif
#endif

  cin >> m >> n >> p;
  for (int i = 1; i <= m; ++i) cin >> name[i];
  string tmp;
  for (int i = 1; i <= p; ++i) {
    cin >> tmp;
    tmp.pop_back();
    for (int j = 1; j <= m; j++)
      if (name[j] == tmp) {
        atc[i] = j;
        break;
      }
    getchar();
    getline(cin, str[i]);
    while (!isalpha(str[i].back())) str[i].pop_back();
  }
  for (int weekday = 0; weekday < 7; ++weekday)
    for (int gty = 1; gty <= m; ++gty) {
      conflict = false, memset(fake, 0, sizeof(fake));
      for (int i = 1, person; i <= p; ++i) {
        person = atc[i];
        if (str[i] == "I am guilty") set(person, gty == person ? 1 : -1);
        if (str[i] == "I am not guilty") set(person, gty != person ? 1 : -1);
        for (int j = 0; j < 7; ++j)
          if (str[i] == day[j]) {
            set(person, j == weekday ? 1 : -1);
            break;
          }
        for (int j = 1; j <= m; ++j) {
          if (str[i] == name[j] + " is guilty") set(person, j == gty ? 1 : -1);
          else if (str[i] == name[j] + " is not guilty")
            set(person, j != gty ? 1 : -1);
        }
      }
      int cnt = 0, uncertain = 0;
      for (int i = 1; i <= m; ++i) {
        if (fake[i] == -1) ++cnt;
        else if (fake[i] == 0)
          ++uncertain;
      }
      if (!conflict && cnt <= n && cnt + uncertain >= n) {
        if (guilty && guilty != gty) return cout << "Cannot Determine", 0;
        else
          guilty = gty;
      }
    }
  if (!guilty) cout << "Impossible";
  else
    cout << name[guilty];
  return 0;
}